﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Quizgame
{
    public partial class FormAdmin : Form
    {
        Class1 ac = new Class1();
        public FormAdmin()
        {
            InitializeComponent();
        }

        private void FormAdmin_Load(object sender, EventArgs e)
        {
            txt_pass.Focus();
            txt_user.Text = "admin";
            txt_pass.Text = "123";
        }

        private void btn_exit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btn_signin_Click(object sender, EventArgs e)
        {
            if (txt_user.Text.ToString().CompareTo("admin") == 0 & txt_pass.Text.ToString().CompareTo("123") == 0)
            {
                MessageBox.Show("Đăng nhập thành công!", "Login", MessageBoxButtons.OK, MessageBoxIcon.Information);

                Formchinh frm = new Formchinh();
                this.Visible = false;
                frm.ShowDialog();
                
                this.Close();
            }
            else
            {
                MessageBox.Show("Có lỗi! Đăng nhập lại!", "Login", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txt_pass.Text = ""; //xóa pass trên textbox
                txt_user.Text = ""; //xóa user trên textbox
            }
        }
    }
}
